#include "form.h"
#include "ui_form.h"


Form::Form(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui->setupUi(this);
    resize(720,450);
}

Form::~Form()
{
    delete ui;
}
//通过按钮调出游戏窗口
void Form::on_pushButton_clicked()
{
    Widget*btn=new Widget;
    btn->show();
    this->close();
}
//给开始界面放置背景
void Form::paintEvent(QPaintEvent*event)
{
    QPainter painter(this);
    QPixmap pix;
    pix.load("D:/snake/background3");
    painter.drawPixmap(0,0,720,450,pix);
}

